﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using System.IO;

namespace StudentOrganizer
{
    [Serializable()]
    class Student
    {
        string firstName;
        string lastName;
        int facultyNumber;

        public string FirstName
        {
            get { return firstName; }
            set { firstName = value; }
        }

        public string LastName
        {
            get { return lastName; }
            set { lastName = value; }
        }

        public int FacultyNumber
        {
            get { return facultyNumber; }
            set { facultyNumber = value; }
        }

        public Student(string firstName, string lastName, int facultyNumber)
        {
            this.firstName = firstName;
            this.lastName = lastName;
            this.facultyNumber = facultyNumber;
        }

        public byte[] GetBytes()
        {
            Byte[] bytes = Encoding.UTF8.GetBytes(this.ToString());
	        return bytes;
        }

        public override string ToString()
        {
            string result = String.Format("{0} {1} {2} | ",this.firstName, this.lastName, this.facultyNumber);
            return result;
        }
    }
}
